//
//  RemandView.m
//  星期一
//
//  Created by 来定MAC on 15/8/4.
//  Copyright (c) 2015年 LD. All rights reserved.
//

#import "RemandView.h"
#import <Masonry.h>

@interface RemandView ()

@property(nonatomic,weak)UIImageView *remandImgV;
@property(nonatomic,weak)UIImageView *signImgV;

@end

@implementation RemandView

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        //1. 设置背景图
        UIImageView *remandImgV = [[UIImageView alloc] init];
        //获取沙盒图片
        NSString *remandImagePath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"remandImage.png"];
        UIImage *remandImage = [UIImage imageWithContentsOfFile:remandImagePath];
        if(remandImage != nil)
        {
            [remandImgV setImage:remandImage];
        }else{
            [remandImgV setImage:[UIImage imageNamed:@"login_bg"]];
        }
        [self addSubview:remandImgV];
        self.remandImgV = remandImgV;
        //2. 设置今日推荐
        UIImageView *signImgV = [[UIImageView alloc] init];
        //[signImgV setBackgroundColor:[UIColor redColor]];
        signImgV.image = [UIImage imageNamed:@"splash_word"];
        [self addSubview:signImgV];
        self.signImgV = signImgV;
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    [self.remandImgV setFrame:self.bounds];
    
    [self.signImgV mas_makeConstraints:^(MASConstraintMaker *make) {
     
         make.left.equalTo(self.mas_left).with.offset(50);
         make.bottom.equalTo(self.mas_bottom).with.offset(-80);
         make.right.equalTo(self.mas_right).with.offset(-50);
         make.height.mas_equalTo(30);
        
     }];
     
}

@end
